Skip to content

fix(api-client): retry rate limit responses - #370

Closed
jameskraus wants to merge 1 commit into
argos-ci:mainfrom
jameskraus:jameskraus/retry-429
Closed

jameskraus wants to merge 1 commit into
argos-ci:mainfrom
jameskraus:jameskraus/retry-429

Conversation

@jameskraus

@jameskraus jameskraus commented Aug 21, 2026 •

Copy link
Copy Markdown

Description

Work in progress PR.

Retry HTTP 429 responses in apiFetch instead of returning the first rate-limit response immediately.

The implementation reuses the existing configurable p-retry budget, so the default remains four total attempts across network errors, 5xx responses, and 429 responses. For each retryable 429 it:

  • honors the numeric Retry-After value emitted by the Argos rate limiter;
  • falls back to 60 seconds for a missing or invalid value;
  • caps the server delay at five minutes and adds up to five seconds of positive jitter;
  • cancels the discarded response body and keeps the delay responsive to caller cancellation; and
  • returns the final 429 response untouched after retries are exhausted, preserving the existing body and error-formatting path.

Type of changes

bug

Checklist

  • I have read the CONTRIBUTING doc (the document referenced by this template is not present in the repository)
  • The commit message follows the Conventional Commits policy
  • Lint and unit tests pass locally
  • I have added tests if needed

Optional checks:

  • My changes require a change to the documentation
  • I have updated the documentation accordingly

Further comments

n/a

Honor Retry-After with bounded jitter inside the existing retry budget, preserve the final 429 response, and keep caller cancellation responsive during the delay.

Co-Authored-By: Codex <codex@openai.com>
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

@jameskraus is attempting to deploy a commit to the Argos Team on Vercel.

A member of the Team first needs to authorize it.

@gregberge

Copy link
Copy Markdown
Member

@jameskraus is the PR ready to be reviewed?

@jameskraus

Copy link
Copy Markdown
Author

@gregberge, not at the moment, just a draft of some changes I'm working on. Will test internally first + clean up this PR description.

Specifically told my agent to hold on this draft, sorry for the early ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants